package Fourth;

public class Fruit1
{
    public class Fruit{
        public double weight;
        public String color;
        public void info()
        {
            System.out.println("-----水果的重量为："+weight+"-----水果颜色为： "+color+" ");
        }
    }
    public class Apple extends Fruit{
        public void main(String[] args)
        {
            Apple a1=new Apple();
            a1.weight=2;
            a1.color="red";
            a1.info();
        }
    }
    public class Banana extends Fruit{
        public void main(String[] args)
        {
            Banana b1=new Banana();
            b1.weight=1.5;
            b1.info();
        }
    }
    public class Mangguo extends Fruit{
        public void main(String[] args)
        {
            Banana c1=new Banana();
            c1.weight=1.5;
            c1.info();
        }
    }
}
